package com.swe.chums.dao.factory;

import com.swe.chums.dao.*;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

public class DaoFactory
{
	/**
	 * Method 'createActivityTypeDao'
	 * 
	 * @return ActivityTypeDao
	 */
	public static ActivityTypeDao createActivityTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (ActivityTypeDao) bf.getBean( "ActivityTypeDao" );
	}
        
        /**
	 * Method 'createLessonsDao'
	 * 
	 * @return LessonsDao
	 */
	public static LessonsDao createLessonsDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (LessonsDao) bf.getBean( "LessonsDao" );
	}

	/**
	 * Method 'createCommentDao'
	 * 
	 * @return CommentDao
	 */
	public static CommentDao createCommentDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (CommentDao) bf.getBean( "CommentDao" );
	}

	/**
	 * Method 'createCommentLikeDao'
	 * 
	 * @return CommentLikeDao
	 */
	public static CommentLikeDao createCommentLikeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (CommentLikeDao) bf.getBean( "CommentLikeDao" );
	}
        
        /**
	 * Method 'createCourseRelationDao'
	 * 
	 * @return CourseRelationDao
	 */
	public static CourseRelationDao createCourseRelationDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (CourseRelationDao) bf.getBean( "CourseRelationDao" );
	}

	/**
	 * Method 'createFeedbackDao'
	 * 
	 * @return FeedbackDao
	 */
	public static FeedbackDao createFeedbackDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (FeedbackDao) bf.getBean( "FeedbackDao" );
	}

	/**
	 * Method 'createRatingDao'
	 * 
	 * @return RatingDao
	 */
	public static RatingDao createRatingDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RatingDao) bf.getBean( "RatingDao" );
	}

	/**
	 * Method 'createRatingTypeDao'
	 * 
	 * @return RatingTypeDao
	 */
	public static RatingTypeDao createRatingTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (RatingTypeDao) bf.getBean( "RatingTypeDao" );
	}

	/**
	 * Method 'createSourceDao'
	 * 
	 * @return SourceDao
	 */
	public static SourceDao createSourceDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (SourceDao) bf.getBean( "SourceDao" );
	}

	/**
	 * Method 'createTagDao'
	 * 
	 * @return TagDao
	 */
	public static TagDao createTagDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (TagDao) bf.getBean( "TagDao" );
	}

	/**
	 * Method 'createTagTypeDao'
	 * 
	 * @return TagTypeDao
	 */
	public static TagTypeDao createTagTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (TagTypeDao) bf.getBean( "TagTypeDao" );
	}

	/**
	 * Method 'createUserDao'
	 * 
	 * @return UserDao
	 */
	public static UserDao createUserDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserDao) bf.getBean( "UserDao" );
	}

	/**
	 * Method 'createUserActivityDao'
	 * 
	 * @return UserActivityDao
	 */
	public static UserActivityDao createUserActivityDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserActivityDao) bf.getBean( "UserActivityDao" );
	}

	/**
	 * Method 'createUserFavoriteDao'
	 * 
	 * @return UserFavoriteDao
	 */
	public static UserFavoriteDao createUserFavoriteDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserFavoriteDao) bf.getBean( "UserFavoriteDao" );
	}

	/**
	 * Method 'createUserTypeDao'
	 * 
	 * @return UserTypeDao
	 */
	public static UserTypeDao createUserTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserTypeDao) bf.getBean( "UserTypeDao" );
	}

	/**
	 * Method 'createWebResourceDao'
	 * 
	 * @return WebResourceDao
	 */
	public static WebResourceDao createWebResourceDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (WebResourceDao) bf.getBean( "WebResourceDao" );
	}

	/**
	 * Method 'createWebResourceTypeDao'
	 * 
	 * @return WebResourceTypeDao
	 */
	public static WebResourceTypeDao createWebResourceTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (WebResourceTypeDao) bf.getBean( "WebResourceTypeDao" );
	}
        
        
        /**
	 * Method 'createUserTagTypeDao'
	 * 
	 * @return UserTagTypeDao
	 */
	public static UserTagTypeDao createUserTagTypeDao()
	{
		BeanFactory bf = new XmlBeanFactory( new ClassPathResource("dao-beans.xml") );
		return (UserTagTypeDao) bf.getBean( "UserTagTypeDao" );
	}

}
